package cn.lee.cplibrary.widget.webview;

import android.Manifest;

/**
 * 多媒体WebView权限管理类
 * Create by ChrisLee on 2022-03-23
 */

public final class MediaWVPermissions {
    private MediaWVPermissions() {
        throw new RuntimeException("Stub!");
    }

    //************************* (Uni_App) ****************************
    public static final class UNI{
        private UNI() {
            throw new RuntimeException("Stub!");
        }
        public static final   int PES_REQUESTCODE_UNI = 0;
        public static final   String[] PES_UNI = {
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
                Manifest.permission.READ_EXTERNAL_STORAGE,
        };
    }

    //************************* (高德) ****************************
    public static final class GaoDe{ //在此之前UNI已经请求存储权限
        public static final int PES_REQUESTCODE = 1;

        //如果设置了target > 28，且要后台定位，需要增加这个权限，否则不会弹出"始终允许"这个选择框
        public static final String BACK_LOCATION_PERMISSION = "android.permission.ACCESS_BACKGROUND_LOCATION";
        /**
         * target<=28或不需后台定位，需要进行检测的权限数组
         */
        public static final   String[] PES_GD = {
                Manifest.permission.ACCESS_COARSE_LOCATION,
                Manifest.permission.ACCESS_FINE_LOCATION,
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
                Manifest.permission.READ_EXTERNAL_STORAGE,
                Manifest.permission.READ_PHONE_STATE,
        };
        /**
         * target > 28且需后台定位，进行检测的权限数组：
         */
        public static final   String[] PES_GD28 = {
                Manifest.permission.ACCESS_COARSE_LOCATION,
                Manifest.permission.ACCESS_FINE_LOCATION,
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
                Manifest.permission.READ_EXTERNAL_STORAGE,
                Manifest.permission.READ_PHONE_STATE,
                BACK_LOCATION_PERMISSION//需要后台定位权限
        };
    }
    //************************* (客服) ****************************
    public static final class Service{
        public static final int PES_REQUESTCODE = 2;

        public static final   String[] PES_RECORD = {//录制视频
                Manifest.permission.WRITE_EXTERNAL_STORAGE,//写
                Manifest.permission.READ_EXTERNAL_STORAGE,//读
                Manifest.permission.RECORD_AUDIO,//录制音频权限
                Manifest.permission.CAMERA,//相机权限
        };
        public static final   String[] PES_TAKE_PHOTOS= {//照相
                Manifest.permission.WRITE_EXTERNAL_STORAGE,//写
                Manifest.permission.READ_EXTERNAL_STORAGE,//读
                Manifest.permission.CAMERA,//相机权限
        };
        public static final   String[] PES_ALBUM = {//图库
                Manifest.permission.WRITE_EXTERNAL_STORAGE,//写
                Manifest.permission.READ_EXTERNAL_STORAGE,//读
        };
    }

}
